package cn.edu.lingnan.controllerV1;




import cn.edu.lingnan.service.StudentStatisticsService;
import cn.edu.lingnan.user.dtos.Result;

import cn.edu.lingnan.user.pojos.PageBean;
import cn.edu.lingnan.user.vos.StudentStatisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student-statistics")
public class StudentStatisticsController {

    @Autowired
    private StudentStatisticsService studentStatisticsService;

    // 分页查询所有考生的统计信息
    @GetMapping("/list")
    public Result<PageBean<StudentStatisticsVO>> getStudentStatistics(
            @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "10") Integer pageSize
    ) {
        PageBean<StudentStatisticsVO> pageBean = studentStatisticsService.getStudentStatistics(page, pageSize);
        return Result.success(pageBean);
    }
}
